<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./node_modules/vue/dist/vue.js"></script>
  <style>
    .red {
      color: red
    }

    .blue {
      color: blue
    }

    .font-size {
      font-size: 50px;
    }
  </style>
</head>

<body>
  <div id="app">
    <h1 :class="classes" class="bg">hello vue!</h1>
  </div>

  <script>
    // class 值可以是对象也可以是数组

    const app = new Vue({
      el: "#app",
      data: {
        isRed: true,
        // classes: ["red", "font-size"]
        classes: [
          {
            red: true
          }, {
            "font-size": true
          }
        ]
        // classes: {
        //   red: true,
        //   blue: true
        // }
      },

    })
  </script>
</body>

</html>
